package com.fruit.utils;

import com.fruit.web.vo.shopcart.InventoryItem;

public final class InventoryUtil {
	public InventoryUtil() {
	  }
	public static InventoryItem getInventoryItemByParam(String code, String primaryCategoryCode,String specialField1, String specialField2){ 
        InventoryItem result = new InventoryItem();
        if (null == code || "".equals(code)) {
        	return result;
        }
       /* if (EjdConstants.PRIMARY_CATEGORY_CODE_SHOES.equals(primaryCategoryCode)) {
        	IShoesService<Shoes,Long> shoesService = (IShoesService<Shoes,Long>)SpringFacesUtil.getSpringBean(SpringBeanConstants.SHOES_SERVICE_BEAN_NAME);
    		shoesService.setEntityClass(Shoes.class);
    		shoesService.setPKClass(Long.class);
    		Shoes shoes = shoesService.findUniqueBy("code", code);
    		BeanCopier copyHere = BeanCopier.create(Shoes.class,InventoryItem.class,false);
    		copyHere.copy(shoes, result, null);
    		result.setSpecialField1(specialField1);
    		IColorService<Color,Long> colorService = (IColorService<Color,Long>)SpringFacesUtil.getSpringBean(SpringBeanConstants.COLOR_SERVICE_BEAN_NAME);
    		colorService.setEntityClass(Color.class);
    		colorService.setPKClass(Long.class);
    		Color color = colorService.findUniqueBy("colorId", specialField1);
    		String colorNameN18 = MessageFactory.getMessage(EjdConstants.USER_BUNDLE_NAME,color.getColorName(), FacesMessage.SEVERITY_ERROR).getDetail();
    		result.setSpecialField1Description(colorNameN18);
    		result.setSpecialField2(specialField2);
    		ISizeService<Size,Long> sizeService = (ISizeService<Size,Long>)SpringFacesUtil.getSpringBean(SpringBeanConstants.SIZE_SERVICE_BEAN_NAME);
    		sizeService.setEntityClass(Size.class);
    		sizeService.setPKClass(Long.class);
    		Size size = sizeService.findUniqueBy("sizeId", specialField2);
    		result.setSpecialField2Description(size.getSizeName());
        }*/
        return result;
    }
}
